{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "from numpy import genfromtxt\n",
    "import matplotlib.pyplot as plt\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAEACAYAAAC9Gb03AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHdpJREFUeJzt3X2QXNWZ3/HvI5jRtDQavSRjCAiPwCAje40ZuSSzYROP\nsGQv3hS4KilkZWtj8KxrKS02IS6vhfOHVKXCC664KCprlVB2AioXGgS7jo23SAQKmk0clz0D2Ib1\nSIQyK4GJ0bRtRVm2BiRWT/7oO6LV6umXe/t233v696nqUvft6e5zpjXPPfc5b+buiIhIuBZ0ugAi\nIpIuBXoRkcAp0IuIBE6BXkQkcAr0IiKBU6AXEQlc3UBvZmNmdtzMXqjy3JfM7IyZrSg7dreZvWxm\nh83sE60usIiINKeRFv1DwCcrD5rZSmATcKzs2BrgFmANcCOwy8ysNUUVEZE46gZ6d/8+cKLKU/cD\nX644djPwqLu/4+5HgZeB9UkLKSIi8cXK0ZvZTcBr7v5ixVOXAq+VPX49OiYiIh1yYbMvMLMC8FVK\naRsREcm4pgM98D5gFfDTKP++EnjezNZTasG/t+xnV0bHzmNmWmRHRCQGd2+q77PR1I1FN9z9b9z9\nYne/wt0vB34BDLv7DPAEsNnMes3scuBKYLJGYYO9bd++veNlUP1Uv26sX8h1c4/XPm5keOU+4AfA\najN71cxuq4zXZSeBaeAxYBp4EtjqcUsmIiItUTd14+7/us7zV1Q8/lPgTxOWS0REWkQzY1MyMjLS\n6SKkSvXLt5DrF3Ld4rJOZVbMTFkdEZEmmRmeUmesiIjklAK9iEjgFOhFRAKnQC8iEjgFehGRwCnQ\ni4gEToFeRCRwCv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NqRuOuzHQAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x161a7a87eb8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "data = np.genfromtxt('data.csv',delimiter = ',')\n",
    "x_data = data[:,0,np.newaxis]\n",
    "y_data = data[:,1,np.newaxis]\n",
    "plt.scatter(x_data,y_data)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(100, 1)\n",
      "(100, 1)\n",
      "(100, 2)\n"
     ]
    }
   ],
   "source": [
    "print(np.mat(x_data).shape) #np.mat 矩阵形式  shape 打印形状\n",
    "print(np.mat(y_data).shape)\n",
    "X_data = np.concatenate((np.ones((100,1)),x_data),axis = 1) #concatenate 组合\n",
    "print((X_data).shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#标准方程法求解线性回归\n",
    "def Stand_equation(Xarr,Yarr):\n",
    "    Xmat = np.mat(Xarr)\n",
    "    Ymat = np.mat(Yarr)\n",
    "    xtx = Xmat.T * Xmat\n",
    "    if np.linalg.det(xtx) == 0.0:\n",
    "        print(\"no eigenvalues\")\n",
    "        return \n",
    "    sw = xtx.I*Xmat.T*Ymat\n",
    "    return sw"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[ 7.99102098]\n",
      " [ 1.32243102]]\n"
     ]
    }
   ],
   "source": [
    "w = Stand_equation(X_data,y_data)\n",
    "print(w)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAEACAYAAAC9Gb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lcW0Hm0ZtZb+Al\nwh+Qp76uACZT4sVV5VQ4ZmYHABe7+1FxuT4z24bQU3JCmuOf7j48LtcHYGa7AncBbYF5wBlAa+Jz\nfe0I17Ctu1enjsXi95earj0AWAFMJSwx04E0r00FUyIiMaetBEVEYk6BXkQk5hToRURiToFeRCTm\nFOhFRGJOgV5EJOYU6EVEYk6BXkQk5v4/M3xuBL0fqQ4AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x161a6e38828>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#画图\n",
    "x_test = np.array([[20],[80]])\n",
    "y_test = w[0] + x_test*w[1]\n",
    "plt.plot(x_data,y_data,'b.')\n",
    "plt.plot(x_test,y_test,'r')\n",
    "plt.show()"
   ]
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python [Root]",
   "language": "python",
   "name": "Python [Root]"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
